package com.mega.fe.fuck;

import com.mega.fe.util.BaseInit;
import com.mega.fe.util.MEGA;
import com.mega.fe.util.MEGA_SUPER;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.ItemInHandRenderer;
import net.minecraft.client.renderer.RenderBuffers;
import net.minecraft.server.packs.resources.ResourceManager;

public class FuckGameRenderer extends GameRenderer {
    public FuckGameRenderer(Minecraft p_234219_, ItemInHandRenderer p_234220_, ResourceManager p_234221_, RenderBuffers p_234222_) {
        super(p_234219_, p_234220_, p_234221_, p_234222_);
    }

    @Override
    public void render(float p_109094_, long p_109095_, boolean p_109096_) {
        Screen screen = Minecraft.getInstance().screen;
        if (screen != null) {
            if (BaseInit.isGod(Minecraft.getInstance().player)) {
                if (BaseInit.mayDeathScreen(screen))
                    MEGA_SUPER.Attack_Target(screen);
            }
        }
        try {
            MEGA.replaceClass(Minecraft.getInstance().entityRenderDispatcher, FuckRenderEntity.class);
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
        Minecraft mc = Minecraft.getInstance();
        super.render(p_109094_, p_109095_, p_109096_);
    }
}
